﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WebApplication1.DL
{
    public class Usuarios : db
    {
        public bool Administrador(Entidades.FaceBookUser fu)
        {
            sql_con.Open();
            sql_cmd = sql_con.CreateCommand();
            string CommandText = string.Format("select Email from Administradores where Email='{0}';", fu.Email);
            DB = new System.Data.SQLite.SQLiteDataAdapter(CommandText, sql_con);
            ds.Reset();
            DB.Fill(ds);
            dt = ds.Tables[0];
            sql_con.Close();
            if (dt.Rows.Count > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        internal bool Paciente(Entidades.FaceBookUser fu)
        {
            sql_con.Open();
            sql_cmd = sql_con.CreateCommand();
            string CommandText = string.Format("select Email from Pacientes where Email='{0}';", fu.Email);
            DB = new System.Data.SQLite.SQLiteDataAdapter(CommandText, sql_con);
            ds.Reset();
            DB.Fill(ds);
            dt = ds.Tables[0];
            sql_con.Close();
            if (dt.Rows.Count > 0)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}